<?php

$i=0;
$rlt = array();

$data = array();

foreach($pager->getResults() as $cust) {

    $data[$i]["id"] = $cust->getId();
    $data[$i]["cell"] = array(
        $cust->getId(),
        $cust->getcustNo(),
        $cust->getCustName(),
        $cust->getCustFname(),
        $cust->getCustType(),
        $cust->getCustAddr(),
        $cust->getCustAddr1(),
        $cust->getCustZip(),
        $cust->getCustTel(),
        $cust->getCustContact(),
        $cust->getCustFax(),
        $cust->getCustMemo(),
        $cust->getCustOpr()->getFullName(),
        $cust->getCreatedAt(),
        $cust->getUpdatedAt()
    );

    $i++;

}

$rlt["page"] = $pager->getPage();
$rlt["total"] = $pager->getLastPage();
$rlt["records"] = $pager->count();  //总记录数
$rlt["rows"] = $data;    //记录

echo json_encode($rlt);